#!/bin/bash
# shellcheck disable=SC2016

curl -L sd.xunyou.com | \
sed \
-e "s#/home/deck#/home/${USER}#g" \
-e 's#wlan0#$(ip route show default | grep -oP "dev \\K\\S+")#g' \
-e "/xunyou_daemon.sh \${DOWNLOAD_DIR\}/a\sed -i 's#/home/deck#/home/${USER}#g' \$\{DOWNLOAD_DIR\}/xunyou_daemon.sh" \
-e "/xunyou_daemon.sh \${DOWNLOAD_DIR\}/a\sed -i 's#wlan0#$(ip route show default | grep -oP "dev \\K\\S+")#g' \$\{DOWNLOAD_DIR\}/xunyou_daemon.sh" | sudo sh
